import Vue from 'vue'
import VueRouter from 'vue-router'
import HelloWorld from '../components/HelloWorld.vue'
import Home from '../views/Home.vue'
import Add from '../views/Add.vue'
import Update from '../views/Update.vue'
import Nav1 from '../views/Nav_1.vue'
import Nav2 from '../views/Nav_2.vue'
import Nav3 from '../views/Nav_3.vue'
import Nav4 from '../views/Nav_4.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Nav1',
    component: HelloWorld,
    children: [
      {
        path: '/nav1',
        name: 'Manage',
        component: Home
      },
      {
        path: '/nav2',
        name: 'Add',
        component: Add
      }
    ]
  },
  {
    path: '/',
    name: 'Nav2',
    component: HelloWorld,
    children: [
      {
        path: '/nav3',
        name: 'Nav3',
        component: Nav3
      },
      {
        path: '/nav4',
        name: 'Nav4',
        component: Nav4
      }
    ]
  },
  {
    path: '/update',
    name: 'Update',
    component: Update,
    hidden: true,
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
